function r60tor51(d60) result(d51)

    use iasing_osse, only: &
        r60_dat, &
        r51_dat, &
        NLM51,   &
        NLM60,   &
        L51RT

    implicit none

    type(r60_dat) :: d60
    type(r51_dat) :: d51

    include "interpolProf_f.interface"

    d51%dim%nopro = d60%dim%nopro
    d51%dim%lev   = L51RT
    d51%dim%wia   = d60%dim%wia
    d51%dim%wng   = d60%dim%wng
    d51%dim%ocl   = d60%dim%ocl

    d51%coo     = d60%coo
    
    d51%opa     = d60%opa

    d51%vpr%tem = interpolProf_f(NLM60, d60%dim%lev, d60%vpr%tem, &
        NLM51, d51%dim%lev)
    d51%vpr%q = interpolProf_f(NLM60, d60%dim%lev, d60%vpr%q, &
        NLM51, d51%dim%lev)
    d51%vpr%co2 = interpolProf_f(NLM60, d60%dim%lev, d60%vpr%co2, &
        NLM51, d51%dim%lev)
    d51%vpr%o3 = interpolProf_f(NLM60, d60%dim%lev, d60%vpr%o3, &
        NLM51, d51%dim%lev)
    d51%vpr%co = interpolProf_f(NLM60, d60%dim%lev, d60%vpr%co, &
        NLM51, d51%dim%lev)
    d51%vpr%ch4 = interpolProf_f(NLM60, d60%dim%lev, d60%vpr%ch4, &
        NLM51, d51%dim%lev)
    d51%vpr%so2 = interpolProf_f(NLM60, d60%dim%lev, d60%vpr%so2, &
        NLM51, d51%dim%lev)
    
    d51%cld%cc  = interpolProf_f(NLM60, d60%dim%lev, d60%cld%cc, &
        NLM51, d51%dim%lev)
    d51%cld%lwc  = interpolProf_f(NLM60, d60%dim%lev, d60%cld%lwc, &
        NLM51, d51%dim%lev)
    d51%cld%iwc  = interpolProf_f(NLM60, d60%dim%lev, d60%cld%iwc, &
        NLM51, d51%dim%lev)
    d51%cld%rwc  = interpolProf_f(NLM60, d60%dim%lev, d60%cld%rwc, &
        NLM51, d51%dim%lev)
    d51%cld%swc  = interpolProf_f(NLM60, d60%dim%lev, d60%cld%swc, &
        NLM51, d51%dim%lev)

    d51%rbt      = d60%rbt

    d51%obs      = d60%obs
    
end function
